<template>
  <view>
    <view>
      <view class="item" v-for="(n,i) in config.list" :key="i" @click="config.itemClick">
        <view class="top">
          <image class='imageInnerStyle' :src="n.image_url" mode="aspectFill"></image>
        </view>
        <view class="center">
          <view class="text">{{ n.name }}</view>
          <view v-for="(tip, i) in n.label" :key="i" class="tip" :style="{background:modelGet('diyConfig.base_color')}">
            {{ tip }}
          </view>
        </view>
        <view class="bottom">
          <view class="address">{{ n.address }}</view>
          <view class="times">{{ n.total || 0 }}人预定过</view>
        </view>
      </view>
    </view>

  </view>
</template>
<script>
import * as util from '@/common/util'
import _ from 'lodash'

export default {
  props: {
    // 检测类型 + 其他验证
    config: {
      type: Object,
    },
  },
  components: {},
  data(){
    return {
      list: [],
    }
  },
  computed: {},
  onLoad(){
    //   组件中不执行
    console.log(`onLoad`, 1)
  },
  mounted(){
    //   组件中不执行
    console.log(`computed 47`, 1)
  },
  methods: {},
}
</script>
<style lang="scss">
.item {
  padding-bottom: 24px;
  .top {
    height: 360px;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
  }
  .center {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
    margin: 22px 0 16px;
    .text {
      height: 40px;
      line-height: 40px;
      font-size: 32px;
      font-weight: 600;
      color: #ffffff;

      //width: 224px;
      //overflow: hidden;
      //text-overflow: ellipsis;
      //white-space: nowrap;
    }
    .tip {
      height: 36px;
      line-height: 34px;
      padding: 0 10px;
      margin-left: 20px;
      color: #ffffff;
      font-size: 24px;
      background-color: #fa6208;
      border-radius: 4px;
    }
  }
  .bottom {
    display: flex;
    justify-content: space-between;
    .address {
      font-size: 24px;
      color: rgba(255, 255, 255, 0.8);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .times {
      white-space: nowrap;
      font-size: 24px;
      color: rgba(255, 255, 255, 0.8);
    }
  }
}


</style>
